package thread.pipe_stream;

import java.io.IOException;
import java.io.PipedOutputStream;

/**
 * Created by mHandler on 2018/6/2 0002.
 * Description:
 */
public class WriteData {
    public void writeMethod(PipedOutputStream out){
        try {
            System.out.println("write :");
            for (int i = 0; i < 100; i++){
                String outData = " " + (i + 1);
                out.write(outData.getBytes());
                System.out.print(outData);
            }
            System.out.println();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
